//
//  QryCinemaDetailRequest.m
//  EasyToo
//
//  Created by zhengzhe on 13-8-25.
//
//

#import "QryCinemaDetailRequest.h"

@implementation QryCinemaDetailRequest

- (id)initQryCinemaDetail:(id<ServerCommunicationDelegate>)delegate filmId:(NSString*)filmId cinemaId:(NSString*)cinemaId
{
    self = [super init];
    if (self) {
        self.delegate = delegate;
        
        self.requestName = @"QryCinemaDetailRequest";
        
        [self.headerJsonDict setObject:@"018003" forKey:@"TranCode"];
        
        NSDate *  senddate=[NSDate date]; 
        NSCalendar  * cal=[NSCalendar  currentCalendar];
        NSUInteger  unitFlags=NSDayCalendarUnit|NSMonthCalendarUnit|NSYearCalendarUnit;
        NSDateComponents * conponent= [cal components:unitFlags fromDate:senddate];
        NSInteger year=[conponent year];
        NSInteger month=[conponent month];
        NSInteger day=[conponent day];
        NSString * nsDateString;
        if (month > 9) {
            nsDateString = [NSString  stringWithFormat:@"%4d-%2d-%2d",year,month,day];
        }else{
            nsDateString = [NSString  stringWithFormat:@"%4d-0%d-%2d",year,month,day];
        }
        
        
        [self.bodyJsonDict setObject:filmId forKey:@"filmId"];
        [self.bodyJsonDict setObject:nsDateString forKey:@"showDate"];
        [self.bodyJsonDict setObject:cinemaId forKey:@"cinemaId"];
        
        [self buildJsonRequest];
    }
    return self;
}


@end
